﻿using OnWork.DataCenter.DAL.Common;
using SqlSugar;

namespace OnWork.DataCenter.DAL.DataCenter
{
    /// <summary>
    /// 数据类型
    /// </summary>
    public enum DataStandardType
    {
        /// <summary>
        /// Json格式
        /// </summary>
        Json = 0,

        /// <summary>
        /// 数据库表
        /// </summary>
        DataTable = 1,
        /// <summary>
        /// 数据库
        /// </summary>
        DataBase = 2,
        /// <summary>
        /// 消息队列
        /// </summary>
        Mqtt = 3,
        /// <summary>
        /// Http请求
        /// </summary>
        Http =4,
        /// <summary>
        /// 变量
        /// </summary>
        Variables=5,
        /// <summary>
        /// Exe程序执行
        /// </summary>
        Exe =6

    }

    /// <summary>
    /// 数据标准配置
    /// </summary>
    public class DataStandard : BaseEntity
    {
        /// <summary>
        /// 数据标准名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        ///需要解析的数据示例
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
        public string DataDemo { get; set; }

        /// <summary>
        /// 数据类型
        /// </summary>
        public DataStandardType DataType { get; set; } = DataStandardType.Json;

        /// <summary>
        /// 输出类型
        /// </summary>
        public DataStandardType OutType { get; set; } = DataStandardType.DataTable;

        /// <summary>
        ///标准配置
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
        public string StandardConfig { get; set; }
    }
}